<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: Key Exchange Set</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Key Exchange Set</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A collection of key exchanges for a set of recipients. The data protected inside 'exchange_ciphertext' for each recipient is derived by each recipient node using their individualized key exchange. See Wickr white paper 'Prepare Packet Header' section for more information.  <a href="structwickr__key__exchange__set.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9d247f82fda4d9ad7cb6784cd591c90e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#ga9d247f82fda4d9ad7cb6784cd591c90e">wickr_key_exchange_set_create</a> (<a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *sender_pub, wickr_exchange_array_t *exchanges)</td></tr>
<tr class="separator:ga9d247f82fda4d9ad7cb6784cd591c90e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae071583943c5c6abe8acc4bcfba032ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#gae071583943c5c6abe8acc4bcfba032ba">wickr_key_exchange_set_find</a> (const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *exchange_set, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *identifier)</td></tr>
<tr class="separator:gae071583943c5c6abe8acc4bcfba032ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga102baafda8804a97acc5e2a5bc6f7dba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#ga102baafda8804a97acc5e2a5bc6f7dba">wickr_key_exchange_set_copy</a> (const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *source)</td></tr>
<tr class="separator:ga102baafda8804a97acc5e2a5bc6f7dba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadaff24901ec60f83216c03c13bff3e2f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#gadaff24901ec60f83216c03c13bff3e2f">wickr_key_exchange_set_destroy</a> (<a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> **exchange_set)</td></tr>
<tr class="separator:gadaff24901ec60f83216c03c13bff3e2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf31dcf7493d3eccd4b31b0ff2a79f536"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#gaf31dcf7493d3eccd4b31b0ff2a79f536">wickr_key_exchange_set_serialize</a> (const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *exchange_set)</td></tr>
<tr class="separator:gaf31dcf7493d3eccd4b31b0ff2a79f536"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec93a83e2f00a707caf371b340591324"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#gaec93a83e2f00a707caf371b340591324">wickr_key_exchange_set_create_from_buffer</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:gaec93a83e2f00a707caf371b340591324"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae67dccec73422de186348b3552f9c17b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#gae67dccec73422de186348b3552f9c17b">wickr_key_exchange_set_encrypt</a> (const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *exchange_set, const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *header_key)</td></tr>
<tr class="separator:gae67dccec73422de186348b3552f9c17b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga398eef2370517ab8b12d35a2d2475c4e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__key__exchange__set.html#ga398eef2370517ab8b12d35a2d2475c4e">wickr_key_exchange_set_create_from_cipher</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *cipher_result, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *header_key)</td></tr>
<tr class="separator:ga398eef2370517ab8b12d35a2d2475c4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga102baafda8804a97acc5e2a5bc6f7dba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga102baafda8804a97acc5e2a5bc6f7dba">&#9670;&nbsp;</a></span>wickr_key_exchange_set_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a>* wickr_key_exchange_set_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a key exchange set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the key exchange set to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated key exchange set holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="ga9d247f82fda4d9ad7cb6784cd591c90e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d247f82fda4d9ad7cb6784cd591c90e">&#9670;&nbsp;</a></span>wickr_key_exchange_set_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a>* wickr_key_exchange_set_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>sender_pub</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_exchange_array_t *&#160;</td>
          <td class="paramname"><em>exchanges</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a key exchange set from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sender_pub</td><td>see '<a class="el" href="structwickr__key__exchange__set.html" title="A collection of key exchanges for a set of recipients. The data protected inside &#39;exchange_ciphertext...">wickr_key_exchange_set</a>' property documentation property documentation </td></tr>
    <tr><td class="paramname">exchanges</td><td>see '<a class="el" href="structwickr__key__exchange__set.html" title="A collection of key exchanges for a set of recipients. The data protected inside &#39;exchange_ciphertext...">wickr_key_exchange_set</a>' property documentation property documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated key exchange set owning the properties passed in </dd></dl>

</div>
</div>
<a id="gaec93a83e2f00a707caf371b340591324"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaec93a83e2f00a707caf371b340591324">&#9670;&nbsp;</a></span>wickr_key_exchange_set_create_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a>* wickr_key_exchange_set_create_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a key exchange set from bytes</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine to use for importing key information within the exchange set </td></tr>
    <tr><td class="paramname">buffer</td><td>the buffer containing a serialized representation of a '<a class="el" href="structwickr__key__exchange__set.html" title="A collection of key exchanges for a set of recipients. The data protected inside &#39;exchange_ciphertext...">wickr_key_exchange_set</a>' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a key exchange set built from the bytes of 'buffer' or NULL if deserialization fails </dd></dl>

</div>
</div>
<a id="ga398eef2370517ab8b12d35a2d2475c4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga398eef2370517ab8b12d35a2d2475c4e">&#9670;&nbsp;</a></span>wickr_key_exchange_set_create_from_cipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a>* wickr_key_exchange_set_create_from_cipher </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>cipher_result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>header_key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypt-Then-Deserialize a packet key exchange set</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine capable of decryption using header_key </td></tr>
    <tr><td class="paramname">cipher_result</td><td>an encrypted key exchange set </td></tr>
    <tr><td class="paramname">header_key</td><td>the key to use for decryption </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a decrypted key exchange set or NULL if the decryption key is incorrect </dd></dl>

</div>
</div>
<a id="gadaff24901ec60f83216c03c13bff3e2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadaff24901ec60f83216c03c13bff3e2f">&#9670;&nbsp;</a></span>wickr_key_exchange_set_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_key_exchange_set_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> **&#160;</td>
          <td class="paramname"><em>exchange_set</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a key exchange set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exchange_set</td><td>a pointer to the key exchange set to destroy. All properties of '*exchange_set' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae67dccec73422de186348b3552f9c17b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae67dccec73422de186348b3552f9c17b">&#9670;&nbsp;</a></span>wickr_key_exchange_set_encrypt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_key_exchange_set_encrypt </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td>
          <td class="paramname"><em>exchange_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>header_key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize-Then-Encrypt a packet key exchange set</p>
<p>The packet key exchange set is serialized using protocol buffers (message.pb-c.h)</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exchange_set</td><td>the key_exchange_set to encrypt </td></tr>
    <tr><td class="paramname">engine</td><td>a crypto engine capable of encryption using header_key </td></tr>
    <tr><td class="paramname">header_key</td><td>the key to encrypt the key exchange set with </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an encrypted key exchange set </dd></dl>

</div>
</div>
<a id="gae071583943c5c6abe8acc4bcfba032ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae071583943c5c6abe8acc4bcfba032ba">&#9670;&nbsp;</a></span>wickr_key_exchange_set_find()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a>* wickr_key_exchange_set_find </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td>
          <td class="paramname"><em>exchange_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>identifier</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find a particular exchange in the exchange set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exchange_set</td><td>the exchange set to search </td></tr>
    <tr><td class="paramname">identifier</td><td>the identifier of the exchange to find </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the key exchange for 'identifier' or NULL if it cannot be found </dd></dl>

</div>
</div>
<a id="gaf31dcf7493d3eccd4b31b0ff2a79f536"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf31dcf7493d3eccd4b31b0ff2a79f536">&#9670;&nbsp;</a></span>wickr_key_exchange_set_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_key_exchange_set_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td>
          <td class="paramname"><em>exchange_set</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a key exchange set using protocol buffers</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exchange_set</td><td>the exchange set to serialize into bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bytes representing 'exchange_set' with protocol buffers or NULL if serialization fails </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
